<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://localhost:8080" />
<title>createItem</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">createItem</td></tr>
</thead><tbody>
<tr>
	<td>open</td>
	<td>/shwitter/image/index</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>//td[@class='name']</td>
	<td></td>
</tr>
<tr>
	<td>verifyElementPresent</td>
	<td>//label[@for='item.amount']</td>
	<td></td>
</tr>
<tr>
	<td>verifyElementPresent</td>
	<td>//label[@for='item.description']</td>
	<td></td>
</tr>
<tr>
	<td>verifyElementPresent</td>
	<td>//a[@class='addButton']</td>
	<td></td>
</tr>
<tr>
	<td>verifyElementNotPresent</td>
	<td>//a[@class='addButton'][2]</td>
	<td></td>
</tr>
<tr>
	<td>verifyElementPresent</td>
	<td>//input[@value='Upload and add More']</td>
	<td></td>
</tr>
<!--Test default messages appear when nothing is added-->
<tr>
	<td>clickAndWait</td>
	<td>//input[@value='Upload and add More']</td>
	<td></td>
</tr>
<tr>
	<td>verifyText</td>
	<td>//div[@class='errors']//li[1]</td>
	<td>Amount must not be empty</td>
</tr>
<tr>
	<td>verifyText</td>
	<td>//div[@class='errors']//li[2]</td>
	<td>The item must be assigned to at least one category</td>
</tr>
<!--Create a simple item-->
<tr>
	<td>type</td>
	<td>id=item.title</td>
	<td>Simple Item</td>
</tr>
<tr>
	<td>type</td>
	<td>id=item.amount</td>
	<td>10.12</td>
</tr>
<tr>
	<td>type</td>
	<td>id=item.description</td>
	<td>this is a description of something simple</td>
</tr>
<tr>
	<td>type</td>
	<td>id=category.category</td>
	<td>Home</td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>//input[@value='Upload and add More']</td>
	<td></td>
</tr>
<tr>
	<td>verifyTextNotPresent</td>
	<td>Amount must not be empty</td>
	<td></td>
</tr>
<tr>
	<td>verifyTextNotPresent</td>
	<td>The item must be assigned to at least one category</td>
	<td></td>
</tr>
<tr>
	<td>verifyText</td>
	<td>//div[@class='message']</td>
	<td>Item has been successfully added</td>
</tr>
<!--Click upload and go to the items list-->
<tr>
	<td>type</td>
	<td>id=item.title</td>
	<td>Simple Item to test with</td>
</tr>
<tr>
	<td>type</td>
	<td>id=item.amount</td>
	<td>11.12</td>
</tr>
<tr>
	<td>type</td>
	<td>id=item.description</td>
	<td>this is a description of something simple</td>
</tr>
<tr>
	<td>type</td>
	<td>id=category.category</td>
	<td>Home</td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>//input[@value='Upload']</td>
	<td></td>
</tr>
<tr>
	<td>verifyTitle</td>
	<td>Item List</td>
	<td></td>
</tr>

</tbody></table>
</body>
</html>
